﻿@{
    ViewBag.User = Session["user"];
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title - Web Instagram</title>
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")
</head>
<body>
    <div class="navbar navbar-default navbar-static-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                @Html.ActionLink("Web Instagram", "Index", "Home", null, new { @class = "navbar-brand" })
            </div>
            <div class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    <li>@Html.ActionLink("Home", "Index", "Home")</li>
                    <li>@Html.ActionLink("About", "About", "Home")</li>
                    <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
                </ul>
                <ul class="nav navbar-nav navbar-right">
                    @if (Request.Cookies["atoken"] == null || Request.Cookies["userid"] == null)
                    {
                        <li><a href="https://api.instagram.com/oauth/authorize/?client_id=8f4cc297898647dbb935db5fcf5e45ea&redirect_uri=http://localhost:37971/Home/Index&response_type=code&scope=basic+comments+relationships+likes">Login</a></li>
                    }
                    else
                    {
                        <li>
                            @if (ViewBag.User != null)
                            {
                                <a href='@Url.Action("User", "Home", new{ViewBag.User.Id})'>
                                    <img src="@ViewBag.User.ProfilePicture" style="width: 24px; height: 24px;" />
                                    &nbsp;@ViewBag.User.FullName
                                </a>
                            }
                        </li>
                    }
                </ul>
            </div>
        </div>
    </div>
    <div class="container body-content">
        @RenderBody()
    </div>
    <hr />
    <div class="container">
        <footer>
            <p>&copy; @DateTime.Now.Year - Celery</p>
        </footer>
    </div>
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/bootstrap")
    <script src="@Url.Content("~/Scripts/global.js")"></script>
    @RenderSection("scripts", required: false)
</body>
</html>
